﻿//-----------------------------------------------------------------------
// <copyright file="PivotTableCellStringType.cs" company="Forebrain Technology, LLC">
//
// Copyright (c) Forebrain Technology, LLC. All rights reserved.
// 
// This source code is released under the Microsoft Public License (Ms-PL).
//
// </copyright>
//-----------------------------------------------------------------------
namespace PivotCollectionTools.Data
{
    using System;

    /// <summary>
    /// A string type cell.
    /// </summary>
    [Serializable]
    public class PivotTableCellStringType : PivotTableCell, IColumnDataType
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PivotTableCellStringType"/> class.
        /// </summary>
        /// <param name="column">The column the cell is associated with.</param>
        public PivotTableCellStringType(PivotTableColumn column)
            : base(column)
        {
            this.Text = string.Empty;
        }

        /// <summary>
        /// Gets or sets the text of the cell.
        /// </summary>
        /// <value>The of the cell text.</value>
        public string Text { get; set; }

        /// <summary>
        /// Gets the value.
        /// </summary>
        /// <value>The value.</value>
        public override string Value
        {
            get { return this.Text; }
            set { this.Text = value; }
        }

        /// <summary>
        /// Gets the type of the data.
        /// </summary>
        /// <value>The type of the data.</value>
        public override PivotTableCellType DataType
        {
            get { return PivotTableCellType.Text; }
        }
    }
}
